<template>
    <el-container class="layout-container-demo" >
        <el-aside width="200px">
            <el-scrollbar>
                <el-menu :default-openeds="['1', '1']">
                    <el-sub-menu index="1">
                        <template #title>
                            <el-icon>
                               <Headset></Headset>
                            </el-icon>个人音乐管理
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1" @click="toMyLikes">我喜欢的音乐</el-menu-item>
                            <el-menu-item index="1-2" @click="toMyMusic">我发布的音乐</el-menu-item>
                            <el-menu-item index="1-5"  @click="toMyArticle">我发布的文章</el-menu-item>
                            <el-menu-item index="1-3">下载记录</el-menu-item>
                            <el-menu-item index="1-4"  @click="toEcharts">个人喜好</el-menu-item>
                        </el-menu-item-group>



                    </el-sub-menu>
                    <el-sub-menu index="2">
                        <template #title>
                            <el-icon><Avatar></Avatar></el-icon>个人信息管理
                        </template>
                        <el-menu-item-group>

                            <el-menu-item index="2-1"  @click="toMyDetail">查看个人信息</el-menu-item>
                            <el-menu-item index="2-2"  @click="toChangeDetail">修改个人信息</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>


                    <el-sub-menu index="3">
                        <template #title>
                            <el-icon><Monitor /></el-icon>系统管理
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="3-1"  @click="toUserRoot">用户管理</el-menu-item>
                            <el-menu-item index="3-2"  @click="toMusicAdmin">音乐管理</el-menu-item>
                            <el-menu-item index="3-3"  @click="toArticleAdmin">文章管理</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                </el-menu>
            </el-scrollbar>
        </el-aside>

        <el-container>


            <el-main>
                <myLikes v-if="infoValue==1"></myLikes>
                <myMusic v-if="infoValue==2"></myMusic>
                <myArticle v-if="infoValue==3"></myArticle>
                <Echarts v-if="infoValue==5"></Echarts>
                <userDetail v-if="infoValue==6"></userDetail>
                <personalDia v-if="infoValue==7"></personalDia>
                <userRoot v-if="infoValue==8"></userRoot>
                <articleAdmin  v-if="infoValue==10"></articleAdmin>
            </el-main>
        </el-container>
    </el-container>
   <div id="s1"></div>
</template>
  
<script lang="ts" setup>
import { ref } from 'vue'
import { Menu as IconMenu, Message, Setting,Headset,Avatar,Monitor  } from '@element-plus/icons-vue'
import { useRouter , useRoute} from "vue-router";
import myMusic from './myMusic.vue';
import myArticle from './myArticle.vue';
import myLikes from './myLikes.vue'
import userDetail from './userDetail.vue'
import personalDia from './personalDia.vue'
import Echarts from './Echarts.vue'
import userRoot from '@/views/userRoot/index.vue'
import articleAdmin from '@/views/article/detail/articleAdmin.vue'

const router = useRouter();
const route = useRoute();
//控制显示哪个表格
const infoValue=ref(0)
const toEcharts=()=>{
   infoValue.value=5
}
const toMyDetail=()=>{
   infoValue.value=6
}
const toChangeDetail=()=>{
    infoValue.value=7
}
const toUserRoot=()=>{
    infoValue.value=8
}
const toArticleAdmin=()=>{
    infoValue.value=10
}
const toMyLikes=()=>{
   infoValue.value=1
}

const toMyMusic=()=>{
   infoValue.value=2
}
const toMyArticle=()=>{
    infoValue.value=3
}
const item = {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
}
const tableData = ref(Array.from({ length: 20 }).fill(item))
</script>
  
<style scoped>
.layout-container-demo .el-header {
    position: relative;
    background-color: var(--el-color-primary-light-7);
    color: var(--el-text-color-primary);
}

.layout-container-demo .el-aside {
    color: var(--el-text-color-primary);
    background: var(--el-color-primary-light-8);
}

.layout-container-demo .el-menu {
    border-right: none;
}

.layout-container-demo .el-main {
    padding: 0;
}

.layout-container-demo .toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    right: 20px;
}
</style>
  